package com.caiyouxi.boss.buser.model;

import com.caiyouxi.common.bean.QueryParams;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户基本信息表。
 */
public class SysUserProfileBean extends QueryParams implements Serializable {

    private Integer id; //用户编号

    private Integer owner; //所属合作伙伴编号。

    private Integer created_by; //该账号由谁创建的。

    private Date create_time; //该账号的创建时间。

    private String status; //DELETED：被删除.DISABLED：被禁用的。NORMAL：或其他值表示正常的。

    private String nickname;// 昵称

    private String username; //用户名。如果用户使用手机号、邮箱或来自于第三方，则该字段根据规则生成一个随机的用户名。

    private String password; //用户密码，如果该字段为 NULL，则表示该用户还没有设置密码。当用户绑定了 phone 或/和 email、之后，才需要设置密码。

    private String password_algorithm; //密码算法。CLEAR：明文；MD5：32位MD5哈希；SHA：SHA 哈希；其他算法以后可以扩展。

    private String salt; //保存密码时使用的随机字符串。

    private String settings; //该用户的个性化配置信息。

    private String realname; //用户真实姓名

    private String id_card; //身份证号

    private String roles;  //角色列表

    private String auth_status; //实名认证状态。VERIFIED：已认证；VERIFYING：正在认证（填写了符合规则的姓名和身份证，但是为提交公安系统认证）。目前如果提交了实名信息，则该字段都是VERIFYING，即只校验有没有提交实名信息。

    private String last_login_log; //用户最新的登录日志信息

    private String gender;     //性别。MALE：男性 FEMALE：女性 PRIVATE：保密的，不愿透露的。如果为空则表示未设置。其他跨性别等先不考虑

    private String picture;    //用户头像的地址

    private String departments;  //该用户所属部门。参见 sys_departments：部门信息表。多个部门使用|分隔。

    private Date birthday;       //出生日期

    private Integer remark;  //删除标志

    //表外字段
    private String phone;  //用户电话

    private String email;  //用户邮箱

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getOwner() {
        return owner;
    }

    public void setOwner(Integer owner) {
        this.owner = owner;
    }

    public Integer getCreated_by() {
        return created_by;
    }

    public void setCreated_by(Integer created_by) {
        this.created_by = created_by;
    }

    public Date getCreate_time() {
        return create_time;
    }

    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPassword_algorithm() {
        return password_algorithm;
    }

    public void setPassword_algorithm(String password_algorithm) {
        this.password_algorithm = password_algorithm;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getSettings() {
        return settings;
    }

    public void setSettings(String settings) {
        this.settings = settings;
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getId_card() {
        return id_card;
    }

    public void setId_card(String id_card) {
        this.id_card = id_card;
    }

    public String getAuth_status() {
        return auth_status;
    }

    public void setAuth_status(String auth_status) {
        this.auth_status = auth_status;
    }

    public String getLast_login_log() {
        return last_login_log;
    }

    public void setLast_login_log(String last_login_log) {
        this.last_login_log = last_login_log;
    }

    public String getRoles() {
        return roles;
    }

    public void setRoles(String roles) {
        this.roles = roles;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public String getDepartments() {
        return departments;
    }

    public void setDepartments(String departments) {
        this.departments = departments;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getRemark() {
        return remark;
    }

    public void setRemark(Integer remark) {
        this.remark = remark;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public boolean equals(Object obj) {
        if(this ==obj){
            return true;
        }
        if(obj==null || getClass()!=obj.getClass()){
            return false;
        }
        SysUserProfileBean bean = (SysUserProfileBean)obj;
        if(!id.equals(bean.id))return false;
        return username.equals(bean.username);
    }

    @Override
    public int hashCode() {
        int result = id.hashCode();
        result = 31*result+username.hashCode();
        return result;
    }
}